package com.orange.bean.core.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 一言目录
 *
 * @Author YWF
 * @Date 2025/9/9 12:35
 */
public enum OneSayCategory {
    ANIME("动画", "Anime - 动画", "a"),
    COMIC("漫画", "Comic - 漫画", "b"),
    GAME("游戏", "Game - 游戏", "c"),
    LITERATURE("文学", "Literature - 文学。主要收录现代文学：小说、散文、戏剧。", "d"),
    ORIGINAL("原创", "Original - 原创", "e"),
    INTERNET("网络", "Internet - 来自网络", "f"),
    OTHER("其他", "Other - 其他", "g"),
    VIDEO("影视", "Video - 影视", "h"),
    POEM("诗词", "Poem - 诗词。主要收录中国古代文学，如：诗、歌、词、赋、曲等。", "i"),
    NCM("网易云", "NCM - 网易云。主要收录网易云音乐热评。", "j"),
    PHILOSOPHY("哲学", "Philosophy - 哲学", "k"),
    FUNNY("抖机灵", "Funny - 抖机灵", "l");

    private final String name;
    private final String desc;
    private final String key;

    private static final Map<String, OneSayCategory> BY_KEY = new HashMap<>();

    static {
        for (OneSayCategory category : values()) {
            BY_KEY.put(category.key, category);
        }
    }

    OneSayCategory(String name, String desc, String key) {
        this.name = name;
        this.desc = desc;
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    public String getKey() {
        return key;
    }

    public static OneSayCategory getByKey(String key) {
        return BY_KEY.get(key);
    }

    @Override
    public String toString() {
        return "Category{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                ", key='" + key + '\'' +
                '}';
    }
}